<h1>Quote Status</h1>

<?php
    $this->headTitle('Quote Status');
    $acl = $this->acl;
?>
<div class="clearing">
</div>

<?php if  ($acl->isAllowed($this->currentUser, 'access quote pages')): ?>
<a href="<?php echo $this->url(array(
            'module'        =>  'default', 
            'controller'    =>  'quote'
        ), NULL, true); ?>">Quotes</a> |
<?php endif; ?> 

<a href="<?php echo $this->url(array(
        'module'        => 'default',
        'controller'    => 'quotestatus',
        'action'        => 'create'
        )); ?>">Create Quote status</a>

<br />

<?php
    echo $this->form;
?>
<div class="clearing">
</div>
<?php $paginator = ( $this->paginator); ?>
<?php
    $allowedKeys = array('name', 'description');
?>

<?php
 if (count($this->paginator)):
?>


<table class="data_table">
    <tr>
        <th class="short">Name<?php echo $this->sortButtons("name"); ?></th>
        <th class="short">Description</th>
        <th class="short">Action</th>
    </tr>


<?php foreach ($paginator as $item): ?>

<?php
        $itemArray = $item->toArray();
?>
    <tr>
    <?php
        foreach ($itemArray as $key=>$value) {
            if ($key == 'quote_status_id') {
                $quote_status_id = $this->escape($value);
            } 
            if (in_array($key, $allowedKeys)) {
                    echo "<td>" .  $this->escape($value) . "</td>";
                }
            }
     ?>     
            <td>
               <a href="<?php 
                    echo $this->url(array(
                        'module'        =>  'default', 
                        'controller'    =>  'quotestatus', 
                        'action'        =>  'viewdetails', 
                        'quote_status_id'    =>  $quote_status_id,
                    ));                    
                  ?>">
                        <span>View</span>
                </a>
                &nbsp;
                <a href="<?php 
                    echo $this->url(array(
                        'module'        =>  'default', 
                        'controller'    =>  'quotestatus', 
                        'action'        =>  'edit', 
                        'quote_status_id'    =>  $quote_status_id,
                    )); 
             ?>">
                <span>Edit</span>
                </a>

            </td>

    </tr>
<?php endforeach; ?>
    </table>

<div class="pagination">
<?php echo $this->paginationControl($this->paginator, 'Sliding', 'search.phtml'); ?>
</div>
<div class="div_clear"></div>

<?php endif; ?>

<?php
        if ($this->wasSearched and !count($this->paginator)) {
            echo "<br />There are no records matching the search criteria";
        }
?>

